# from app import celery
from celery_task.celery_init import celery
from insects_detection.insects_utils import insects_tools
import json

@celery.task(name="celery_task.classify")
def recompute_detailed_insects_info(chas_data_path,model_path):
    scaler_path='F:\python project\Code warehouse\insects_detection_flask_backend2\insects_detection\\trainning_models\Model4May_scaler.pkl'
    detailed_insects_info = insects_tools.classify_green_house_insects(chas_data_path,model_path,scaler_path)
    detailed_insects_info_json = json.dumps(detailed_insects_info,ensure_ascii=False)
    return {'current': 100, 'total': 100, 'status': 'Task completed!',
            'result': detailed_insects_info_json}

